home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DRIVES.SWG / 0089_Detect Disk Protected Tab.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  702b  |  29 lines

  1. {
  2. > Didn't work. It only checks if the file is there(???) not if the flo
  3. > write-protected. Did I mis understand your suggestion?
  4.  
  5.  Yes i think we must have got our wires crossed, i thunk i was
  6. replying to a request to see if a file exist,  i would have
  7. no reason for telling use the GetFattr to check for a Write
  8. protected disk, that has to be done by getting the Device Statues.
  9. }
  10. Function DiskProtected:Boolean;
  11.  Begin
  12.   ASm
  13.    Mov AH,01;
  14.    mov dl, 0; { 0= A:, 1= B: ect }
  15.    int $13;
  16.    cmp AL, 03;
  17.    Jne @No;
  18.    Mov AL, True;
  19.    Je @done;
  20. @No:
  21.    Xor AL,AL;
  22. @Done:
  23.   Endl
  24. End;
  25.  
  26. { Example: }
  27.  
  28. if Diskprotected Then Write(' Write protect was used on last operation');
  29.